package com.commit.mapper;

import com.commit.domain.Question;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author:zyh
 * @Time:2021-02-28-9:49
 * @email:1269231889@qq.com
 */
@Mapper
public interface QuesMapper {
    void save(Question question);

    Question findById(Integer id);

    //使用@Param标签替代parameterType
    List<Question> findAll(@Param("beginPage") Integer beginPage, @Param("pageCount") Integer pageCount, @Param("title") String title);

    Integer getTotal(@Param("title") String title);

    void update(Question question);

    void del(Integer id);

    List<Question> findByTitle(String title);

    List<Question> findByTitleAndTime(@Param("title") String title
            , @Param("begin") Date begin
            , @Param("end") Date end);
}
